//
//  UINib+Extension.swift
//  SmartEyeForDoctor
//
//  Created by QDSG on 2021/4/20.
//

import UIKit

extension UINib {
    static func loadViewFrom<T: UIView>(_ type: T.Type, owner: String? = nil, options: [UINib.OptionsKey: Any]? = nil) -> T {
        let nibName = String(describing: type)
        let nib = UINib(nibName: nibName, bundle: nil)
        let instantiation = nib.instantiate(withOwner: owner, options: options).first as! T
        return instantiation
    }
}
